import request from '@/utils/request'

// 查询device列表
export function listDevice(query) {
  return request({
    url: '/system/device/list',
    method: 'get',
    params: query
  })
}

export function MapListALL(query) {
  return request({
    url: '/system/device/listAll',
    method: 'get',
    params: query
  })
}
//召唤参数
export function call(query) {
  return request({
    url: '/system/environmentInfo/callParamList',
    method: 'get',
    params: query
  })
}
//下载参数
export function download(query) {
  return request({
    url: '/system/environmentInfo/writeParam',
    method: 'get',
    params: query
  })
}
// 查询device详细
export function getDevice(id) {
  return request({
    url: '/system/device/' + id,
    method: 'get'
  })
}
//校准时间
export function calibrationtime(query) {
  return request({
    url: '/system/environmentInfo/timming',
    method: 'get',
    params: query
  })
}
// 新增device
export function addDevice(data) {
  return request({
    url: '/system/device',
    method: 'post',
    data: data
  })
}

// 修改device
export function updateDevice(data) {
  return request({
    url: '/system/device',
    method: 'put',
    data: data
  })
}

// 删除device
export function delDevice(id) {
  return request({
    url: '/system/device/' + id,
    method: 'delete'
  })
}
// 查询部门项目列表
export function listDept(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}
// 查询我的项目下拉树结构
export function deptTreeSelect() {
  return request({
    url: '/system/user/deptTreeDevice',
    method: 'get'
  })
}
export function NewdeptTreeSelect() {
  return request({
    url: 'system/user/deptTree',
    method: 'get'
  })
}
export function listWarn(query) {
  return request({
    url: '/system/environmentInfo/listWarn',
    method: 'get',
    params: query
  })
}
// 修改warninfo
export function updateWarinfo(data) {
  return request({
    url: '/system/environmentInfo/editWarninfo',
    method: 'put',
    data: data
  })
}